package com.starbaba.buriedPoint.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.base.common.exception.AppException;
import com.base.common.log.LogService;
import com.starbaba.base.dao.LoanManagerBaseDao;
import com.starbaba.buriedPoint.service.BuriedPointDisplayService;
import com.tuanzi.server.loan_base.model.db.buriedpoint.BuriedPoint;


public class BuriedPointDisplayServiceImpl extends LoanManagerBaseDao implements BuriedPointDisplayService{

	@Override
	public List<BuriedPoint> getList(Map<String, Object> paramsMap, int pageNo,
			int pageSize) {
		
		List<BuriedPoint> list = new ArrayList<BuriedPoint>();
		String sql = "SELECT * FROM `buried_point` ORDER BY ctime DESC LIMIT ?,? ";
		
		try {
			list = getDao().list(sql, BuriedPoint.class, pageNo, pageSize);
		} catch (AppException e) {
			LogService.error(e);
		}
		
		return list;
	}

	@Override
	public int countList(Map<String, Object> paramsMap) {
		
		String sql = "SELECT COUNT(*) FROM `buried_point`";
		int result = 0;
		try {
			result = getDao().getInt(sql);
		} catch (AppException e) {
			LogService.error(e);
		}
		return result;
		
	}
	
}
